package edu.jetwinner.util;

import java.util.HashSet;
import java.util.Set;

public final class EasySetUtil {

    private EasySetUtil() {
        // reserved.
    }

    @SuppressWarnings("unchecked")
    public static <E> Set<E> of(E... values) {
        if (values != null && values.length > 0) {
            Set<E> set = new HashSet<>(values.length);
            for (E value : values) {
                set.add(value);
            }
            return set;
        }
        return new HashSet<E>(0);
    }
}
